<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{$school['title']}</title>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width initial-scale=1.0 maximum-scale=1.0 user-scalable=yes" />
<link type="text/css" rel="stylesheet" href="{OSSURL}public/mobile/css/mMessageContent.css?v=4.8" />
<link type="text/css" rel="stylesheet" href="{OSSURL}public/mobile/css/greenStyle.css?v=4.80120" />
{php echo register_jssdk();}
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script type="text/javascript" src="{OSSURL}public/mobile/js/jquery-1.11.3.min.js?v=4.8"></script>
</head>
<body>
<div class="all">
<div id="BlackBg" class="BlackBg"></div>
<div id="titlebar" class="header mainColor">
	<div class="l"><a class="backOff" style="background:url({OSSURL}public/mobile/img/ic_arrow_left_48px_white.svg) no-repeat;background-size: 55% 55%;background-position: 50%;" href="javascript:history.go(-1);"></a></div>
	<div class="m"><span style="font-size: 18px">对话班主任</span></div>
	<div class="r"><a href="#my-menu"></a></div>
</div>
<div id="titlebar_bg" class="_header"></div>
		<!-- 回复消息的输入框 start-->
{php include $this->template('face');}
		<!-- 回复消息的输入框 end-->
		<div class="messageItem">
			<div class="msgPic">
				<div class="avatar">
					<img src="{php echo tomedia($techers[$tid]['thumb'])}" alt="">
				</div>
			</div>
			<div class="msgBody">
				<div class="msgTitle">班主任：{if !empty($techers[$tid]['tname'])}{$techers[$tid]['tname']}{else}本班没有班主任{/if}</div>
				<div class="msgSender l">{if !empty($category[$students['bj_id']])}{$category[$students['bj_id']]['sname']}{/if}</div>
				<div class="msgTime l">邮箱：{$techers[$tid]['email']}</div>
			</div>
			<input id="photostr" type="hidden" value="" />
			<div id="msgContent" class="msgContent">

			</div>
		</div>
		<div class="msgbtn">			
			<div class="div-reply" onclick="showReplyBox();">
				{if !empty($techers[$tid]['tname'])}<div class="btn-huifu">留言回复</div>{/if}
			</div>
			<div class="div-tel">
					<div class="btn-mob">
						<a href="tel:{$techers[$tid]['mobile']}">联系班主任</a>
					</div>
			</div>
		</div>
		<div class="blank"></div>
		<!-- 回复消息 start -->
		<div id="replyMessage">
			<div id="replyTips" class="mainfont tips"><font style="font-size:16px;"></font>回复列表</div>
			 {loop $list $item}
			  <ul id="infoList">
					 <li class="replyItem replyItemborder">
						  <div class="msgPic l">
								<div class="avatar">
									<img src="{if !empty($item['teacherid']) || !empty($row['tuid'])}{php echo tomedia($techers[$tid]['thumb'])}{else}{php echo tomedia($item['avatar'])}{/if}">
								</div>
						  </div>
						  <div class="msgBody">
						  <div class="msgTop">
								<div class="replyName l">{if !empty($item['teacherid']) || !empty($row['tuid'])}{$techers[$tid]['tname']}{else}{$item['nickname']}{/if}</div>
								<div class="msgTime r">{if !empty($item['createtime'])}{php echo (date('m-d H:m',$item['createtime']))}{/if}</div>
						  </div>
								<div class="replyContent">{$item['conet']}</div>
						  </div>
					 </li>	
			   </ul>
			  {/loop}
		</div>
		<!-- 回复消息 end -->
	</div>
{php include $this->template('port');}	
</body>
<!-- 提示框 -->
<script type="text/javascript" src="{OSSURL}public/mobile/js/PromptBoxUtil.js?v=4.81022"></script>
<script type="text/javascript">
var PB = new PromptBox();
icon_replace($(".replyContent"));
WeixinJSHideAllNonBaseMenuItem();
/**微信隐藏工具条**/
function WeixinJSHideAllNonBaseMenuItem(){
	if (typeof wx != "undefined"){
		wx.ready(function () {
			
			wx.hideAllNonBaseMenuItem();
		});
	}
}

function saveReplyMsg(){

	var content = $.trim($("#content_txt").val());
	//content = iphone_emoji_filter(content);
	if (content == "" || content == undefined || content == null) {
        jTips('内容不能为空哦！');
        return false;
	}
	jConfirm("确认发送留言信息？", "删除确定对话框", function (isConfirm) {
		if(isConfirm){
			var submitData = {
				openid :"{$openid}",
				schoolid :"{$schoolid}",
				weid :"{$weid}",
				leaveid :"{$lv['id']}",
				sid :"{$students['id']}",
				uid :"{$it['uid']}",
				tid :"{$tid}",
				bj_id :"{$students['bj_id']}",
				content : content,
			};
				$.post("{php echo $this->createMobileUrl('indexajax',array('op'=>'savemsg'))}",submitData,function(data){
				if(data.result){
					PB.prompt(data.msg);
					location.reload();
				}else{
					PB.prompt(data.msg);
				}
			},'json'); 
		}
	});	
}
</script>
{php include $this->template('footer');}
</html>